<template>
  <j-modal title="门诊信息" :width="800" :visible="visible" switchFullscreen @cancel="handleCancel" @ok="handleOk"
    :footer="null">
    <div class="box">
      <p><span>门诊所在地区：</span>{{ infoObj.regionWords }}</p>
      <p><span>门诊名称：</span>{{ infoObj.name }}</p>
      <p><span>收治点序号：</span>{{ infoObj.serialNumber }}</p>
      <p><span>门诊编号：</span>{{ infoObj.id }}</p>
      <p><span>邮政编码：</span>{{ infoObj.postCode }}</p>
      <p><span>门诊电话：</span>{{ infoObj.phone }}</p>
      <p><span>审批日期：</span>{{ infoObj.approvalTime }}</p>
      <p><span>开诊日期：</span>{{ infoObj.openingTime }}</p>
      <p><span>门诊地址：</span>{{ infoObj.address }}</p>
      <p><span>门诊所属单位所有制形式：</span>{{ setOwnerShipTitle(infoObj.ownership) }}</p>
      <p><span>门诊所属单位性质：</span>{{ setUnitPropertiesTitle(infoObj.unitProperties) }}</p>
    </div>
  </j-modal>
</template>
<script>
import * as treatApi from '@/api/sjsk/help/treat.js'
export default {
  name: 'detailModal',
  data() {
    return {
      visible: false,
      infoObj: {},
    }
  },
  async created() {
  },
  methods: {
    show(id) {
      this.visible = true
      this.getDetail(id)
    },
    getDetail(id) {
      treatApi.getClinicById({ clinicId: id }).then(res => {
        if (res.success) {
          this.infoObj = res.result
        }
      })
    },
    setOwnerShipTitle(text) {
      return this.$filterDictTextByCache('ownership', text)
    },
    setUnitPropertiesTitle(text) {
      return this.$filterDictTextByCache('unitProperties', text)
    },
    handleCancel() {
      this.visible = false
    },
    handleOk() {
      this.visible = false
    }
  },
}
</script>
<style lang="less" scoped>
.box {
  span {
    display: inline-block;
    width: 180px;
    text-align: left;
  }
}
</style>
